﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminSite.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Product Management
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContent" runat="server">
    <h2>
        Product Management</h2>
    <table class="category" border="1">
        <tr>
            <th>
                ID
            </th>
            <th>
                Category
            </th>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
            <th>
                Price
            </th>
            <th>
                Image
            </th>
            <th>
                Active
            </th>
            <th>
                Action
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%: item.Id %>
            </td>
            <td>
                <%: item.CategoryName %>
            </td>
            <td>
                <%: item.Name ?? "" %>
            </td>
            <td>
                <%: MvcHtmlString.Create(item.Description ?? "") %>
            </td>
            <td>
                <%: item.Price ??0 %>
            </td>
            <td>
                <img src="<%: item.Image ?? "" %>" />
            </td>
            <td>
                <%: item.Active ?? "" %>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.Id }) %>
                |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.Id })%>
            </td>
        </tr>
        <% } %>
    </table>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>
